import { acceptHMRUpdate, defineStore } from "pinia";

export const useUserStore = defineStore("user", {
  state: () => {
    return {
      user: JSON.parse(localStorage.getItem("userInfo") as string) ,
    };
  },

  actions: {
    setUser(data:any) {
      this.user = data;
    },
  },
});

if (import.meta.hot)
  import.meta.hot.accept(acceptHMRUpdate(useUserStore, import.meta.hot));
